home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xpcom / nsICollection.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  7KB  |  203 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsICollection.idl
  3.  */
  4.  
  5. #ifndef __gen_nsICollection_h__
  6. #define __gen_nsICollection_h__
  7.  
  8.  
  9. #ifndef __gen_nsISerializable_h__
  10. #include "nsISerializable.h"
  11. #endif
  12.  
  13. #ifndef __gen_nsIEnumerator_h__
  14. #include "nsIEnumerator.h"
  15. #endif
  16.  
  17. /* For IDL files that don't want to include root IDL files. */
  18. #ifndef NS_NO_VTABLE
  19. #define NS_NO_VTABLE
  20. #endif
  21.  
  22. /* starting interface:    nsICollection */
  23. #define NS_ICOLLECTION_IID_STR "83b6019c-cbc4-11d2-8cca-0060b0fc14a3"
  24.  
  25. #define NS_ICOLLECTION_IID \
  26.   {0x83b6019c, 0xcbc4, 0x11d2, \
  27.     { 0x8c, 0xca, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3 }}
  28.  
  29. class NS_NO_VTABLE nsICollection : public nsISerializable {
  30.  public: 
  31.  
  32.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICOLLECTION_IID)
  33.  
  34.   /* PRUint32 Count (); */
  35.   NS_IMETHOD Count(PRUint32 *_retval) = 0;
  36.  
  37.   /* nsISupports GetElementAt (in PRUint32 index); */
  38.   NS_IMETHOD GetElementAt(PRUint32 index, nsISupports **_retval) = 0;
  39.  
  40.   /* void QueryElementAt (in PRUint32 index, in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
  41.   NS_IMETHOD QueryElementAt(PRUint32 index, const nsIID & uuid, void * *result) = 0;
  42.  
  43.   /* void SetElementAt (in PRUint32 index, in nsISupports item); */
  44.   NS_IMETHOD SetElementAt(PRUint32 index, nsISupports *item) = 0;
  45.  
  46.   /* void AppendElement (in nsISupports item); */
  47.   NS_IMETHOD AppendElement(nsISupports *item) = 0;
  48.  
  49.   /* void RemoveElement (in nsISupports item); */
  50.   NS_IMETHOD RemoveElement(nsISupports *item) = 0;
  51.  
  52.   /* nsIEnumerator Enumerate (); */
  53.   NS_IMETHOD Enumerate(nsIEnumerator **_retval) = 0;
  54.  
  55.   /* void Clear (); */
  56.   NS_IMETHOD Clear(void) = 0;
  57.  
  58. };
  59.  
  60. /* Use this macro when declaring classes that implement this interface. */
  61. #define NS_DECL_NSICOLLECTION \
  62.   NS_IMETHOD Count(PRUint32 *_retval); \
  63.   NS_IMETHOD GetElementAt(PRUint32 index, nsISupports **_retval); \
  64.   NS_IMETHOD QueryElementAt(PRUint32 index, const nsIID & uuid, void * *result); \
  65.   NS_IMETHOD SetElementAt(PRUint32 index, nsISupports *item); \
  66.   NS_IMETHOD AppendElement(nsISupports *item); \
  67.   NS_IMETHOD RemoveElement(nsISupports *item); \
  68.   NS_IMETHOD Enumerate(nsIEnumerator **_retval); \
  69.   NS_IMETHOD Clear(void); 
  70.  
  71. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  72. #define NS_FORWARD_NSICOLLECTION(_to) \
  73.   NS_IMETHOD Count(PRUint32 *_retval) { return _to Count(_retval); } \
  74.   NS_IMETHOD GetElementAt(PRUint32 index, nsISupports **_retval) { return _to GetElementAt(index, _retval); } \
  75.   NS_IMETHOD QueryElementAt(PRUint32 index, const nsIID & uuid, void * *result) { return _to QueryElementAt(index, uuid, result); } \
  76.   NS_IMETHOD SetElementAt(PRUint32 index, nsISupports *item) { return _to SetElementAt(index, item); } \
  77.   NS_IMETHOD AppendElement(nsISupports *item) { return _to AppendElement(item); } \
  78.   NS_IMETHOD RemoveElement(nsISupports *item) { return _to RemoveElement(item); } \
  79.   NS_IMETHOD Enumerate(nsIEnumerator **_retval) { return _to Enumerate(_retval); } \
  80.   NS_IMETHOD Clear(void) { return _to Clear(); } 
  81.  
  82. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  83. #define NS_FORWARD_SAFE_NSICOLLECTION(_to) \
  84.   NS_IMETHOD Count(PRUint32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Count(_retval); } \
  85.   NS_IMETHOD GetElementAt(PRUint32 index, nsISupports **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetElementAt(index, _retval); } \
  86.   NS_IMETHOD QueryElementAt(PRUint32 index, const nsIID & uuid, void * *result) { return !_to ? NS_ERROR_NULL_POINTER : _to->QueryElementAt(index, uuid, result); } \
  87.   NS_IMETHOD SetElementAt(PRUint32 index, nsISupports *item) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetElementAt(index, item); } \
  88.   NS_IMETHOD AppendElement(nsISupports *item) { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendElement(item); } \
  89.   NS_IMETHOD RemoveElement(nsISupports *item) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveElement(item); } \
  90.   NS_IMETHOD Enumerate(nsIEnumerator **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Enumerate(_retval); } \
  91.   NS_IMETHOD Clear(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Clear(); } 
  92.  
  93. #if 0
  94. /* Use the code below as a template for the implementation class for this interface. */
  95.  
  96. /* Header file */
  97. class nsCollection : public nsICollection
  98. {
  99. public:
  100.   NS_DECL_ISUPPORTS
  101.   NS_DECL_NSICOLLECTION
  102.  
  103.   nsCollection();
  104.  
  105. private:
  106.   ~nsCollection();
  107.  
  108. protected:
  109.   /* additional members */
  110. };
  111.  
  112. /* Implementation file */
  113. NS_IMPL_ISUPPORTS1(nsCollection, nsICollection)
  114.  
  115. nsCollection::nsCollection()
  116. {
  117.   /* member initializers and constructor code */
  118. }
  119.  
  120. nsCollection::~nsCollection()
  121. {
  122.   /* destructor code */
  123. }
  124.  
  125. /* PRUint32 Count (); */
  126. NS_IMETHODIMP nsCollection::Count(PRUint32 *_retval)
  127. {
  128.     return NS_ERROR_NOT_IMPLEMENTED;
  129. }
  130.  
  131. /* nsISupports GetElementAt (in PRUint32 index); */
  132. NS_IMETHODIMP nsCollection::GetElementAt(PRUint32 index, nsISupports **_retval)
  133. {
  134.     return NS_ERROR_NOT_IMPLEMENTED;
  135. }
  136.  
  137. /* void QueryElementAt (in PRUint32 index, in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
  138. NS_IMETHODIMP nsCollection::QueryElementAt(PRUint32 index, const nsIID & uuid, void * *result)
  139. {
  140.     return NS_ERROR_NOT_IMPLEMENTED;
  141. }
  142.  
  143. /* void SetElementAt (in PRUint32 index, in nsISupports item); */
  144. NS_IMETHODIMP nsCollection::SetElementAt(PRUint32 index, nsISupports *item)
  145. {
  146.     return NS_ERROR_NOT_IMPLEMENTED;
  147. }
  148.  
  149. /* void AppendElement (in nsISupports item); */
  150. NS_IMETHODIMP nsCollection::AppendElement(nsISupports *item)
  151. {
  152.     return NS_ERROR_NOT_IMPLEMENTED;
  153. }
  154.  
  155. /* void RemoveElement (in nsISupports item); */
  156. NS_IMETHODIMP nsCollection::RemoveElement(nsISupports *item)
  157. {
  158.     return NS_ERROR_NOT_IMPLEMENTED;
  159. }
  160.  
  161. /* nsIEnumerator Enumerate (); */
  162. NS_IMETHODIMP nsCollection::Enumerate(nsIEnumerator **_retval)
  163. {
  164.     return NS_ERROR_NOT_IMPLEMENTED;
  165. }
  166.  
  167. /* void Clear (); */
  168. NS_IMETHODIMP nsCollection::Clear()
  169. {
  170.     return NS_ERROR_NOT_IMPLEMENTED;
  171. }
  172.  
  173. /* End of implementation class template. */
  174. #endif
  175.  
  176. #ifndef nsCOMPtr_h__
  177. #include "nsCOMPtr.h"
  178. #endif
  179. class NS_COM nsQueryElementAt : public nsCOMPtr_helper
  180.   {
  181.     public:
  182.       nsQueryElementAt( nsICollection* aCollection, PRUint32 aIndex, nsresult* aErrorPtr )
  183.           : mCollection(aCollection),
  184.             mIndex(aIndex),
  185.             mErrorPtr(aErrorPtr)
  186.         {
  187.           // nothing else to do here
  188.         }
  189.       virtual nsresult NS_FASTCALL operator()( const nsIID& aIID, void** ) const;
  190.     private:
  191.       nsICollection*  mCollection;
  192.       PRUint32        mIndex;
  193.       nsresult*       mErrorPtr;
  194.   };
  195. inline
  196. const nsQueryElementAt
  197. do_QueryElementAt( nsICollection* aCollection, PRUint32 aIndex, nsresult* aErrorPtr = 0 )
  198.   {
  199.     return nsQueryElementAt(aCollection, aIndex, aErrorPtr);
  200.   }
  201.  
  202. #endif /* __gen_nsICollection_h__ */
  203.